<?php

namespace Cuke\Models;

class CukeSecret extends ModelBase
{

    /**
     *
     * @var integer
     * @Primary
     * @Identity
     * @Column(type="integer", length=20, nullable=false)
     */
    public $secret_id;

    /**
     *
     * @var string
     * @Column(type="string", length=50, nullable=false)
     */
    public $secret_code;

    /**
     *
     * @var integer
     * @Column(type="integer", length=11, nullable=false)
     */
    public $user_id;

    /**
     *
     * @var string
     * @Column(type="string", length=200, nullable=false)
     */
    public $secret_name;

    /**
     *
     * @var string
     * @Column(type="string", length=100, nullable=false)
     */
    public $secret_key;

    /**
     *
     * @var string
     * @Column(type="string", length=1000, nullable=false)
     */
    public $secret_value;

    /**
     *
     * @var string
     * @Column(type="string", nullable=false)
     */
    public $create_at;

    /**
     *
     * @var integer
     * @Column(type="integer", length=11, nullable=false)
     */
    public $create_id;

    /**
     *
     * @var string
     * @Column(type="string", nullable=true)
     */
    public $update_at;

    /**
     *
     * @var integer
     * @Column(type="integer", length=11, nullable=true)
     */
    public $update_id;

    /**
     * Initialize method for model.
     */
    public function initialize()
    {
        $this->setSource("cuke_secret");
    }

    /**
     * Returns table name mapped in the model.
     *
     * @return string
     */
    public function getSource()
    {
        return 'cuke_secret';
    }
    public function beforeUpdate()
    {
        $this->update_at = date('Y-m-d H:i:s');
    }
    /**
     * Allows to query a set of records that match the specified conditions
     *
     * @param mixed $parameters
     * @return CukeSecret[]|CukeSecret|\Phalcon\Mvc\Model\ResultSetInterface
     */
    public static function find($parameters = null)
    {
        return parent::find($parameters);
    }

    /**
     * Allows to query the first record that match the specified conditions
     *
     * @param mixed $parameters
     * @return CukeSecret|\Phalcon\Mvc\Model\ResultInterface
     */
    public static function findFirst($parameters = null)
    {
        return parent::findFirst($parameters);
    }

}
